package pro.spring.controller.frontController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;


@Controller
@RequestMapping("coll")
public class CollectController extends BaseController{
	
	private Integer pagesize = 10 ;
	
	private String local = "page/front/coll/";
	
	@RequestMapping(value="list",method=RequestMethod.GET)
	public String list(@RequestParam(value = "p", defaultValue = "1")Integer pagenum,ModelMap map,HttpServletRequest request,
			HttpServletResponse response,@RequestParam(value = "a", defaultValue = "3")Integer a,Integer id){//3文件2视频1文章
		HttpSession session=request.getSession();
		if(id ==  null){
			id = (Integer)session.getAttribute("uId");
		}
		map.put("id",id);
		map.put("a",a);
		map.put("pages",ucollectService.getcollByUid(id,a*100,pagenum, pagesize));
		return local+"coli";
	}
	
	
}
